﻿using System;

using Game.Terrain;

namespace Game.Editor.Toolbox
{
    public class SelectedTerrainTypeEventArgs : EventArgs
    {
        public TerrainType TerrainType
        {
            get; set;
        }
    }
    
    public static class SelectedTerrainType
    {
        public static event EventHandler<SelectedTerrainTypeEventArgs> Selected;
        
        static TerrainType _TerrainType;
        
        public static TerrainType TerrainType
        {
            get { return _TerrainType; }
            set 
            {
                if (_TerrainType != value)
                {
                    _TerrainType = value; 
                    FireSelected();
                }
            }
        }
        
        static void FireSelected()
        {
            if (Selected != null)
            {
                SelectedTerrainTypeEventArgs args = new SelectedTerrainTypeEventArgs();
                args.TerrainType = _TerrainType;
                Selected(_TerrainType, args);
            }
        }
        
    }
}
